{% extends 'application.html' %}
{% block content %}
<div class="row">
    <div class="span6">
        <ul class="nav nav-tabs">
            <li class="active"><a href="/users">列表</a></li>
            <li><a href="/user/new">添加用户</a></li>
        </ul>
    </div>
    <div class="span6">
        <form class="navbar-form pull-right">
            <input type="text" class="span3" placeholder="注册邮箱">
            <button type="submit" class="btn">查询</button>
        </form>
    </div>
</div>
<div class="row">
    <div class="span12">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>账号</th>
                    <th>邮箱</th>
                    <th>状态</th>
                    <th>本月流量</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for user in users %}
                <tr>
                    <td>{{user.id}}</td>
                    <td>{{user.account}}</td>
                    <td>{{user.email}}</td>
                    <td>
                        {% if user.status == 1 %}
                        <span class="label label-success">正常</span>
                        {% else %}
                        <span class="label label-warning">锁定</span>
                        {% endif %}
                    </td>
                    <td>1.2M</td>
                    <td>
                        <a class="btn btn-mini" href="/user/{{user.id}}">查看</a>
                        <a class="btn btn-mini" href="/user/{{user.id}}/edit">设置</a>
                        <a class="btn btn-mini" href="/user/{{user.id}}/destory">删除</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
